package com.jzo2o.customer.controller.agency;

import com.jzo2o.customer.model.dto.response.AgencyCertificationAuditResDTO;
import com.jzo2o.customer.model.dto.response.RejectReasonResDTO;
import com.jzo2o.customer.service.IAgencyCertificationAuditService;
import com.jzo2o.mvc.utils.UserContext;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController("AgencyCertificationAuditController")
@RequestMapping("agency/agency-certification-audit")
@Api(tags = "机构端 - 机构端提交认证接口设计")
public class AgencyCertificationAuditController {
    @Autowired
    IAgencyCertificationAuditService agencyCertificationAuditService;
    @PostMapping()
    @ApiOperation("机构提交认证申请")
    public void add(@RequestBody AgencyCertificationAuditResDTO agencyCertificationAuditAddReqDTO) {
        agencyCertificationAuditAddReqDTO.setServeProviderId(UserContext.currentUserId());
        agencyCertificationAuditService.applyCertification(agencyCertificationAuditAddReqDTO);
    }
    @GetMapping("/rejectReason")
    @ApiOperation("查询最新的驳回原因")
    public RejectReasonResDTO rejectReason() {
        return agencyCertificationAuditService.queryCurrentUserLastRejectReason();
    }
}
